package test

import java.io.{ObjectOutputStream, OutputStream}
import java.net.Socket

object Driver {
  def main(args: Array[String]): Unit = {
//建立与服务器的链接
    val client =new Socket("localhost",9999)
    val out:OutputStream = client.getOutputStream
    val objOut=new ObjectOutputStream(out)
    val task=new Task()
    objOut.writeObject(task)


//    out.write(2)
    println("数据发送完成")
    objOut.flush()
    objOut.close()
    client.close()
  }

}
class  Task extends Serializable {
  val datas=List(1,2,3,4)
  val logic:(Int)=>Int=_*2
  def compute():List[Int]={
    datas.map(logic)
  }
}
